package com.sams.controller;

import com.sams.pojo.Convenient;
import com.sams.service.Class_Service;
import com.sams.service.ConvenientService;
import com.sams.service.NoticeService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/deleteApply")
public class ConvenientDelete extends HttpServlet {
    private Class_Service cs=new Class_Service();
    private ConvenientService convenientService = new ConvenientService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id");
        System.out.println(id);

        boolean deleteclass = convenientService.deleteById(id);
        if (deleteclass){
            response.getWriter().write("success");
        }else {
            response.getWriter().write("no");
        }

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
